# 封装清晰用户信息的方法
from common.db_tools import exe_sql

phone_all = "'13188888810','13188888811','13188888812','13188888813','13188888814','13188888815','13188888816','13188888817','13188888818','13188888819','13188888820'"


# 封装清洗用户信息的方法
def clear_user_info():
    # 需要执行SQL语句
    sql1 = "delete i.* from mb_member_info i inner join mb_member m on m.id = i.member_id where m.phone in ({});".format(phone_all)
    sql2 = "delete l.* from mb_member_login_log l inner join mb_member m on m.id=l.member_id where m.phone in ({});".format(phone_all)
    sql3 = "delete from mb_member where phone in ({});".format(phone_all)
    sql4 = "delete from mb_member_register_log where phone in ({});".format(phone_all)
    # 调用封装操作数据库的方法，执行SQL语句
    exe_sql(sql1, "czbk_member")
    exe_sql(sql2, "czbk_member")
    exe_sql(sql3, "czbk_member")
    exe_sql(sql4, "czbk_member")


if __name__ == '__main__':
    clear_user_info()
